<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{$title}</title>
    <link rel="stylesheet" href="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/layui/2.6.8/css/layui.css">
    <link rel="stylesheet" href="__STATIC__/css/admin_style.css?v=1024">
    <script type="text/javascript" src="__STATIC__/js/jquery.js?v=1024"></script>
    <script type="text/javascript" src="__STATIC__/js/jquery.clipboard.js?v=1024"></script>
    <script type="text/javascript" src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/layui/2.6.8/layui.js"></script>
    <script>
        var ROOT_PATH="__ROOT__",ADMIN_PATH="{$_SERVER['SCRIPT_NAME']}", FFCMS_VERSION='v16';
    </script>
</head>
<body>
<style>
@media screen and (max-width:768px){
	.layui-content,.layui-contentAD {white-space:nowrap;overflow:scroll;position:relative;width:100%;}
	.layui-contentAD td{float: left;width: 100%;}
}
</style>
<div class="p10">
    <div class="showpic" style="display:none;">
        <img class="showpic_img" style="width:100%;height:100%;" referrerPolicy="no-referrer"></div>
    <form class="layui-form layui-form-pane" name="configform" id="configform">
        <div class="layui-tab" lay-filter="dmku" overflow>
            <ul class="layui-tab-title">
                <li class="layui-this">基本设置</li>
                <li class="">广告设置</li>
                <li class="">弹幕列表</li>
                <li class="">举报列表</li>
				<li class="">使用教程</li>
				</ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show" name="基本设置">
                    <blockquote class="layui-elem-quote layui-quote-nm">
                        <p>温馨提示：</p>
                        <p>此款Dplayer播放器只适合在网页端使用，不支持在APP里面使用. 不支持IE8及以下浏览器，采用HLS流媒体播放m3u8,mp4格式视频，无需flash插件</p>
                        <p style="color:red;">一些功能在移动端不会生效，因为部分移动端浏览器会劫持播放器，替换为浏览器自带的播放器。</p>

                    </blockquote>
                    <fieldset class="layui-elem-field">
                        <legend>基本设置</legend>
                        <div class="layui-field-box">
							<div class="layui-form-item">
                                <label class="layui-form-label">自动播放</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox" name="yzm[autoplay]" lay-skin="switch"  lay-filter="switchTest" lay-text="开|关" {if condition="$yzm.autoplay eq 'on'" }checked{/if}></div>
                                <div class="layui-form-mid layui-word-aux">开启后播放器加载完毕自动播放，关闭后需要手动点击播放，有部分浏览器自身原因会不支持</div></div>	
                            <div class="layui-form-item">
                                <label class="layui-form-label">播放器右键</label>
                                <div class="layui-input-inline w300">
                                    <textarea name="yzm[contextmenu]" class="layui-textarea" placeholder="弹幕播放器,https://www.baidu.com">{$yzm.contextmenu}</textarea></div>
                                <div class="layui-form-mid layui-word-aux">自定义播放器右键,说明：前面写名称，用英文逗号分隔，后面填写网址，需加http开头；多个换行填写
                                    <br>例子：弹幕播放器,https://www.baidu.com</div></div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">主题颜色</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="color1" name="yzm[color]" value="{$yzm.color}" placeholder="请选择颜色" class="layui-input"></div>
                                <div class="layui-inline" style="left: -11px;">
                                    <div id="color11"></div>
                                </div>
								<div class="layui-inline" style="left: -30px;"><div class="layui-form-mid layui-word-aux">播放器主题颜色，主要是修改控制栏进度条颜色的</div></div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">视频封面</label>
                                <div class="layui-input-inline long">
                                    <input type="text" name="yzm[pic]" value="{$yzm.pic}" class="layui-input upload-input  upload-img" placeholder="图片地址"></div>
									<div class="layui-form-mid layui-word-aux">视频加载时的预览图片，可以不设置，需为http开头的图片地址</div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">LOGO</label>
                                <div class="layui-input-inline long">
                                    <input type="text" name="yzm[logo]" value="{$yzm.logo}" class="layui-input upload-input upload-img" placeholder="图片地址"></div>
                                <div class="layui-form-mid layui-word-aux">播放器logo，移动网页端不支持显示，可以不设置，需为http开头的图片地址</div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">自定义样式</label>
                                <div class="layui-input-inline w300">
                                    <textarea name="yzm[style]" class="layui-textarea">{$yzm.style}</textarea></div>
                                <div class="layui-form-mid layui-word-aux">自定义样式,例子(自定义logo位置)：".yzmplayer-logo{right: 5% !important;top: 5% !important;}"
                                    <br>备注：left:左边距,right:右边距,top:顶边距,bottom:底边距</div></div>
                        </div>
                    </fieldset>
                    <fieldset class="layui-elem-field">
                        <legend>弹幕设置
                            <input type="checkbox" name="yzm[danmuon]" id="danmuon" lay-skin="switch" lay-filter="danmuStatus" lay-text="开|关" {if condition="$yzm.danmuon eq 'on'" }checked{/if}></legend>
                        <div class="layui-field-box">
                            <div id="danmu" {if condition="$yzm.danmuon neq 'on'" }style="display:none" {/if}>
   
                                <div class="layui-form-item">
                                    <label class="layui-form-label">弹幕发送间隔</label>
                                    <div class="layui-input-inline">
                                        <input type="number" name="yzm[sendtime]" value="{$yzm.sendtime}" min="1" size="30" class="layui-input upload-input" placeholder="单位/秒"></div>
                                    <div class="layui-form-mid layui-word-aux">防止恶意发布弹幕</div></div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">弹幕礼仪链接</label>
                                    <div class="layui-input-inline long">
                                        <input type="text" name="yzm[dmrule]" value="{$yzm.dmrule}" class="layui-input upload-input" placeholder="链接地址"></div>
                                    <div class="layui-form-mid layui-word-aux">弹幕框右边弹幕礼仪按钮的链接地址，默认路径地址：/static/dmku/dm_rule.html</div></div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">禁用关键词</label>
                                    <div class="layui-input-inline long">
                                        <input type="text" name="yzm[pbgjz]" value="{$yzm.pbgjz}" class="layui-input upload-input" placeholder="输入关键字以" , "隔开"></div>
                                    <div class="layui-form-mid layui-word-aux">输入关键字以","隔开</div></div>
                            </div>
                        </div>
                    </fieldset>
                    <div class="layui-form-item">
                        <div class="center">
                            <button class="layui-btn" type="button" lay-submit="" lay-filter="save">立 即 保 存</button></div>
                    </div>
                </div>
                <div class="layui-tab-item" name="广告设置">
					<div class="layui-form-item">
                        <label class="layui-form-label">免广告权限</label>
                            <div class="layui-input-inline">
                                <select name="yzm[ads][group]">
									<option value="" >请选择</option>
									{volist name="group" id="vo"}
										{if condition="$vo['group_id']>1"}
										<option value="{$vo.group_id}" {if condition="$yzm.ads.group eq $vo['group_id']"}selected {/if}>{$vo.group_name}</option>
										{/if}
									{/volist}
								</select>
                        </div>
                        <div class="layui-form-mid layui-word-aux">选择哪个等级的会员可以免看广告，升级VIP会员组后，需要退出重新登陆才生效</div></div>
						
                    <div class="layui-form-item">
                        <label class="layui-form-label">前置广告开关</label>
                        <div class="layui-input-inline">
                            <input type="checkbox" name="yzm[ads][pre][state]" lay-skin="switch" lay-filter="switchTest" lay-text="开|关" {if condition="$yzm.ads.pre.state eq 'on'" }checked{/if}>
                        </div>
						<div class="layui-form-mid layui-word-aux">只支持PC端显示前置广告，移动端有部分浏览器支持，大部分不支持显示。</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">前置广告类型</label>
                        <div class="layui-input-inline">
                            <input type="radio" name="yzm[ads][pre][type]" lay-filter="adsType" value="1" title="视频" {if condition="$yzm.ads.pre.type neq '2'" }checked{/if}>
                            <input type="radio" name="yzm[ads][pre][type]" lay-filter="adsType" value="2" title="图片" {if condition="$yzm.ads.pre.type eq '2'" }checked{/if}></div>
							
                    </div>
                    <div id="adsvod" {if condition="$yzm.ads.pre.type eq '2'" }style="display:none;" {/if}>
                        <div class="layui-form-item">
                            <label class="layui-form-label">视频广告内容</label>
                            <div class="layui-input-inline long">
                                <input type="text" name="yzm[ads][pre][vod_url]" value="{$yzm.ads.pre.vod_url}" class="layui-input upload-input" placeholder="视频地址"></div>
                            <div class="layui-form-mid layui-word-aux">视频地址,支持mp4或者m3u8直链</div></div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">视频广告链接</label>
                            <div class="layui-input-inline long">
                                <input type="text" name="yzm[ads][pre][vod_link]" value="{$yzm.ads.pre.vod_link}"  class="layui-input upload-input" placeholder="点击链接地址"></div>
                            <div class="layui-form-mid layui-word-aux">点击视频跳转链接地址</div></div>
                    </div>
                    <div id="adspic" {if condition="$yzm.ads.pre.type neq '2'" }style="display:none;" {/if}>
                        <div class="layui-form-item">
                            <label class="layui-form-label">图片广告时间</label>
                            <div class="layui-input-inline">
                                <input type="text" name="yzm[ads][pre][pic][time]" value="{$yzm.ads.pre.pic.time}" class="layui-input upload-input" placeholder="单位/秒"></div>
                            <div class="layui-form-mid layui-word-aux">图片广告默认显示时间</div></div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">图片广告内容</label>
                            <div class="layui-input-inline long">
                                <input type="text" name="yzm[ads][pre][pic][img]" value="{$yzm.ads.pre.pic.img}"  class="layui-input upload-input  upload-img" placeholder="图片地址"></div>
                            <div class="layui-form-mid layui-word-aux">广告图片链接，支持jpg、png、gif格式的图片</div></div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">图片广告链接</label>
                            <div class="layui-input-inline long">
                                <input type="text" name="yzm[ads][pre][pic][link]" value="{$yzm.ads.pre.pic.link}"  class="layui-input upload-input" placeholder="点击链接地址"></div>
                            <div class="layui-form-mid layui-word-aux">图片广告点击后跳转地址</div></div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">暂停广告开关</label>
                        <div class="layui-input-inline">
                            <input type="checkbox" name="yzm[ads][pause][state]" lay-skin="switch" lay-filter="switchTest" lay-text="开|关" {if condition="$yzm.ads.pause.state eq 'on'" }checked{/if}>
                        </div>
                        <div class="layui-form-mid layui-word-aux">只支持PC端显示暂停广告，移动端浏览器不支持显示</div></div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">暂停图片链接</label>
                        <div class="layui-input-inline long">
                            <input type="text" name="yzm[ads][pause][pic]" value="{$yzm.ads.pause.pic}"  class="layui-input upload-input  upload-img" placeholder="图片地址"></div>
                        <div class="layui-form-mid layui-word-aux">暂停广告图片链接</div></div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">暂停跳转链接</label>
                        <div class="layui-input-inline long">
                            <input type="text" name="yzm[ads][pause][link]" value="{$yzm.ads.pause.link}"  class="layui-input upload-input" placeholder="点击链接地址"></div>
                        <div class="layui-form-mid layui-word-aux">暂停图片广告点击后跳转地址</div></div>
                    <div class="layui-form-item center">
                        <div>
                            <button class="layui-btn" type="button" lay-submit="" lay-filter="save">立 即 保 存</button></div>
                    </div>
                </div>
                <div class="layui-tab-item" name="弹幕列表">
                    <table class="layui-hide" id="dmlist" lay-filter="dmlist"></table>
                </div>
                <div class="layui-tab-item" name="举报列表">
                    <table class="layui-hide" id="report" lay-filter="report"></table>
                </div>
                <div class="layui-tab-item" name="调用教程">
                    <blockquote class="layui-elem-quote layui-quote-nm">
						<p>以下是手动调用此款播放器的教程：</p>
						<p>第一步，导航栏上找到“视频管理”-“系统播放器”</p>
						<p>第二步，选择指定的播放器，点击“编辑”</p>
						<p>第三步，在弹出的窗口中，选择切换到“播放器代码”</p>
						<p>第四步，复制下方的调用代码，粘贴到“播放器代码”中保存即可</p>
						<p>第五步，一定要清理清理浏览器缓存，否则可能前端不能实时显示</p>
					</blockquote>
					<div class="layui-form-item">
						<label class="layui-form-label">调用代码</label>
						<div class="layui-input-block">
							<textarea class="layui-textarea">FeifeiPlayer.Html='<iframe width="100%" height="'+FeifeiPlayer.Height+'" src="/static/player/cj/dplayer-dm.html" frameborder="0" allowfullscreen="true" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>';FeifeiPlayer.Show();</textarea>
						</div>    
					</div>
                </div>				
            </div>
        </div>
    </form>
</div>

   
	<script type="text/html" id="listbar">
		<a class="layui-btn layui-btn-xs" lay-event="dmedit">编辑</a>
		<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
	</script>
    
        <script type="text/html" id="listTool">
            <div class="layui-btn-group">
		<a class="layui-btn layui-btn-sm" lay-event="edit"><i class="layui-icon  layui-icon-edit"></i></a>
		<a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del"><i class="layui-icon  layui-icon-delete"></i></a>
            </div>    
                <div class="layui-input-inline">
		<input class="layui-input" id="textdemo" placeholder="请输入视频ID或弹幕关键字">
		</div>
               <button  class="layui-btn" type="button"  lay-submit="search_submits" type="button" lay-filter="reloadlst_submit" >搜索</button>
	
        </script>
    
	<script type="text/html" id="reportbar">
		<a class="layui-btn layui-btn-xs" lay-event="edit">误报</a>
		<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
	</script>

    <script type="text/html" id="reportTool">
   
    <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del" title="删除"><i class="layui-icon  layui-icon-delete"></i></a>
 
</script>
    
 
    
    
	<script type="text/Tpl" id="bondTemplateList">
		<div class="layui-card-body" style="padding: 15px;">
        <form class="layui-form" lay-filter="component-form-group" id="submits" onsubmit="return false">
            <div class="layui-row layui-col-space10 layui-form-item">
                <input type="hidden" name="cid" value="{{ d.cid }}">
                <div class="layui-col-lg5">
                    <label class="layui-form-label">弹幕ID：</label>
                    <div class="layui-input-block">
                        <input type="text" name="id" placeholder="请输入名称" autocomplete="off"
                               lay-verify="required" class="layui-input"
                               value="{{ d.id?d.id:'' }}" {{# if(d.id){ }}disabled{{# } }}>
                    </div>
                </div>
                <div class="layui-col-lg5">
                    <label class="layui-form-label">颜色：</label>
  						<div class="layui-input-block">
							<div class="layui-input-inline" style="width: 120px;">
								<input type="text" name="color" placeholder="请选择颜色" class="layui-input" id="test-form-input" value="{{ d.color?d.color:'' }}">
							</div>
						<div class="layui-inline" style="left: -11px;">
						<div id="test-form"></div>
					</div>
				</div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">弹幕内容</label>
                    <div class="layui-input-block">
                    <textarea name="text" placeholder="请输入内容" class="layui-textarea" lay-verify="required">{{ d.text ? d.text:''}}</textarea>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="bond_sumbit">提交</button>
                </div>
            </div>
			
        </form>
    </div>
</script>

{include file="../../../application/admin/view/public/foot" /}

<script type="text/javascript">
install_dir = "{$GLOBALS['config']['site']['install_dir']}";
layui.use(['form', 'laydate', 'laypage', 'table', 'layer', 'element', 'colorpicker'], function() {
	var laydate = layui.laydate,
		laypage = layui.laypage,
		layer = layui.layer,
		table = layui.table,
		element = layui.element,
		form = layui.form,
		laytpl = layui.laytpl,
		colorpicker = layui.colorpicker;
	var api = install_dir + 'static/player/cj/dplayer/';
	element.on('tab(dmku)', function(data) {
		if (data.index == 2) {
			dmlist()
		} else if (data.index == 3) {
			report()
		}
	});

	function dmlist() {
		table.render({
			elem: '#dmlist',
			url: api + '?ac=list',
			title: '用户表',
			page: true,
			toolbar: '#listTool',
			cols: [
				[{
					type: 'checkbox',
					fixed: 'left'
				}, {
					field: 'cid',
					title: 'ID',
					value: [4],
					width: 60,
					align: 'center',
					fixed: 'left',
					totalRowText: '合计：'
				}, {
					field: 'id',
					title: '视频ID',
					width: 200
				}, {
					field: 'user',
					title: '发布者',
					width: 100
				}, {
					field: 'text',
					title: '弹幕内容',
					width: 300
				}, {
					field: 'type',
					title: '类型',
					width: 80
				}, {
					field: 'color',
					title: '弹幕颜色',
					width: 180
				}, {
					field: 'videotime',
					title: '时间点',
					width: 120
				}, {
					field: 'ip',
					title: '发送IP',
					width: 90
				}, {
					field: 'time',
					title: '发送时间',
					width: 110
				}, {
					field: 'size',
					title: '弹幕大小',
					width: 90
				}, {
					fixed: 'right',
					title: '操作',
					width: 120,
					align: 'center',
					toolbar: '#listbar'
				}]
			]
		})
	}
	function report() {
		table.render({
			elem: '#report',
			url: api + '?ac=reportlist',
			title: '用户表',
			page: true,
			toolbar: '#reportTool',
			cols: [
				[{
					type: 'checkbox',
					fixed: 'left'
				}, {
					field: "cid",
					title: 'ID',
					value: [4],
					width: 60,
					align: 'center',
					fixed: 'left',
					fixed: 'left',
					totalRowText: '合计：'
				}, {
					field: "id",
					title: '视频ID',
					width: 100
				}, {
					field: "text",
					title: '弹幕内容',
					width: 300
				}, {
					field: "type",
					title: '举报类型',
					width: 100
				}, {
					field: "ip",
					title: '发送IP',
					width: 100
				}, {
					field: "time",
					title: '发送时间',
					width: 110
				}, {
					fixed: 'right',
					title: '操作',
					width: 120,
					align: 'center',
					toolbar: '#reportbar'
				}]
			]
		})
	}
	table.on('toolbar(dmlist)', function(obj) {
		var checkStatus = table.checkStatus(obj.config.id),
			data = checkStatus.data;
		if (data.length === 0) {
			layer.msg('请选择一行');
			return
		}
		switch (obj.event) {
		case 'add':
			layer.msg('添加');
			break;
		case 'edit':
			if (data.length === 0) {
				layer.msg('请选择一行')
			} else if (data.length > 1) {
				layer.msg('只能同时编辑一个')
			} else {
				editdm(data[0])
			}
			break;
		case 'del':
			if (data.length === 0) {
				layer.msg('请选择一行')
			} else {
				var dmid = new Array();
				data.forEach(function(tm) {
					dmid.push(tm.cid)
				});
				layer.confirm('真的删除选择行么', function(index) {
					delid(dmid.join());
					table.reload('dmlist', {
						url: api + '?ac=list'
					});
					table.reload('report', {
						url: api + '?ac=reportlist'
					});
					layer.close(index)
				})
			}
			break
		}
	});
	table.on('toolbar(report)', function(obj) {
		var checkStatus = table.checkStatus(obj.config.id),
			data = checkStatus.data,
			layEvent = obj.event;
		if (data.length === 0) {
			layer.msg('请选择一行');
			return
		}
		var dmid = new Array();
		data.forEach(function(tm) {
			dmid.push(tm.cid)
		});
		if (layEvent === 'del') {
			layer.confirm('真的删除所选举报列表么', function(index) {
				delid(dmid.join());
				table.reload('dmlist', {
					url: api + '?ac=list'
				});
				layer.close(index)
			})
		} else if (layEvent === 'edit') {
			layer.confirm('真的移除所选举报列表么', function(index) {
				delreport(dmid.join());
				table.reload('report', {
					url: api + '?ac=reportlist'
				});
				layer.close(index)
			})
		}
	});
	table.on('tool(dmlist)', function(obj) {
		var data = obj.data,
			layEvent = obj.event;
		if (layEvent === 'detail') {
			layer.msg('查看操作')
		} else if (layEvent === 'del') {
			layer.confirm('真的删除行么', function(index) {
				obj.del();
				var dmid = data.cid;
				delid(dmid);
				layer.close(index)
			})
		} else if (layEvent === 'dmedit') {
			editdm(data)
		}
	});
	table.on('tool(report)', function(obj) {
		var data = obj.data,
			layEvent = obj.event;
		if (layEvent === 'detail') {
			layer.msg('查看操作')
		} else if (layEvent === 'del') {
			layer.confirm('真的删除行么', function(index) {
				obj.del();
				var dmid = data.cid;
				delid(dmid);
				layer.close(index)
			})
		} else if (layEvent === 'edit') {
			layer.confirm('移除举报么', function(index) {
				obj.del();
				var dmid = data.cid;
				delreport(dmid);
				layer.close(index)
			})
		}
	});
	form.on('submit(reloadlst_submit)', function(data) {
		var key = $('#textdemo').val().trim();
		if (key === '') {
			table.reload('dmlist', {
				url: api + '?ac=list'
			})
		} else {
			table.reload('dmlist', {
				url: api + '?ac=so&key=' + key
			})
		}
	});
	form.on('submit(bond_sumbit)', function(data) {
		layer.msg('正在提交', {
			time: 5000000
		});
		$.ajax({
			type: 'POST',
			data: data.field,
			url: api + '?ac=edit',
			success: function(data) {
				layer.msg('保存完成', {
					time: 1000
					,shade:0.6
				})
			}
		})
	});

	function editdm(data) {
		var content = $("#bondTemplateList").html();
		laytpl(content).render(data, function(string) {
			layer.open({
				type: 1,
				title: "修改弹幕",
				area: ['800px', '350px'],
				content: string
			});
			colorpicker.render({
				elem: '#test-form',
				color: 'rgb(68,66,66)',
				format: 'rgb',
				done: function(color) {
					$('#test-form-input').val(color)
				}
			})
		})
	}
	function delreport(id) {
		$.ajax({
			url: api + "?ac=del&type=report&id=" + id,
			success: function(data) {
				layer.msg('移除成功', {
					time: 1000
				})
			}
		})
	}
	function delid(id) {
		$.ajax({
			url: api + "?ac=del&type=list&id=" + id,
			success: function(data) {
				layer.msg('删除完成', {
					time: 1000
				})
			}
		})
	}
	colorpicker.render({
		elem: '#color11',
		color: $("#color1").val(), 
		predefine: true,
		colors: ['#c93bf4', '#ff8c00', '#00ced1', '#9d8a0e', '#ff6429'],
		done: function(color) {
			$('#color1').val(color)
		}
	});
	form.on('switch(danmuStatus)', function(data) {
		layer.msg('弹幕功能：' + (this.checked ? '开启' : '关闭'));
		if (this.checked) {
			$('#danmu').show()
		} else {
			$('#danmu').hide()
		}
	});
	form.on('radio(adsType)', function(data) {
		if (data.value == 1) {
			$("#adsvod").show();
			$("#adspic").hide()
		} else {
			$("#adspic").show();
			$("#adsvod").hide()
		}
	});
	form.on('submit(save)', function(data) {
		layer.msg('正在提交', {
			time: 30000,
			shade: 0.6,
			icon: 16
		});
		$.ajax({
			type: 'POST',
			data: data.field,
			dataType: 'json',
			url: './system',
			success: function(data) {
				layer.msg('保存完成', {
					time: 1000,
					icon: 1
				})
			}
		});
		return false
	});
	$('.upload-img').hover(function(e) {
		var e = window.event || e;
		var imgsrc = $(this).val();
		if (imgsrc.trim() == "") {
			return
		}
		var left = e.clientX + document.body.scrollLeft + 20;
		var top = e.clientY + document.body.scrollTop + 20;
		$(".showpic").css({
			'left': left,
			'top': top,
			'width': "300px",
			'height': "200px",
			'display': ""
		});
		$(".showpic_img").attr("src", imgsrc)
	}, function(e) {
		$(".showpic").css("display", "none")
	})
});
</script>

</body>
</html>